package com.huamao.niceman.scrollviewpager.base;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;

/**
 * Created by LuanXianSheng on 2017/2/27.
 */

public abstract  class BaseInternetActivity<V,T extends BasePresent<V>>extends AppCompatActivity {
    protected T mPresent ;
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mPresent = creatPresent() ;
        mPresent.attachView((V)this);
    }
    @Override
    protected void onDestroy() {
        super.onDestroy();
        if (mPresent!= null){
            mPresent.detachView();
        }
    }
    public abstract  T creatPresent() ;
}
